#ifndef _PANELHEADER_FILE_INCLUDE_H_
#define _PANELHEADER_FILE_INCLUDE_H_

#define MODIFY_WIDTH_HEIGHT_BGIMAGE

#include "IwNUI.h"
using namespace IwNUI;

namespace IwNUINew
{

	class CPanelNew;

	typedef CSharedPtr<CPanelNew> CPanelNewPtr;

	class CPanelNew : public CView
	{
	protected:
		CPanelNew();
		CPanelNew(const CAttributes& attr);

	public:
		virtual ~CPanelNew();
		
		static CPanelNewPtr Create();
		static CPanelNewPtr Create(const CAttributes& attr);

		////////////////////////////////
		// Attribute
		///////////////////////////////

		void SetBackgroupColor(int r, int b, int g, int alpha);
		void SetBackgroupColor(const CColour& color);
		
		void SetBackgroupImage(const char* imageName);
		void ShowBackgroupImage(bool show);

		/** Set position of panel
		*/
		int	 GetX1();
		void SetX1(int x);
		void SetX1(const char* x);
		int  GetY1();
		void SetY1(int y);
		void SetY1(const char* y);

		int  GetWidth();
		void SetWidth(int w);
		void SetWidth(const char* w);
		int  GetHeight();
		void SetHeight(int h);
		void SetHeight(const char* h);

		bool GetVisible();
		void SetVisible(bool visible);

		/////////////////////
		// Event handler
		/////////////////////
		template<class Handler, class Member>
		void SetClickEventHandler(Handler* pHandler, Member pMember)
		{
			this->SetEventHandler("clickview", pHandler, pMember);
		}

	private:
		CImagePtr m_backgroupImage;
		bool m_activeBackgroupImage;
	};

}
#endif